package com.flitsneak.designpatterns.behavioralpatterns.state;

import com.flitsneak.designpatterns.behavioralpatterns.state.concretestate.*;

/**
 * @author flitsneak
 * @email flitsneak@gmail.com
 * @date 2022/7/18 17:41
 * @description
 */
public class Context {
    public final static NormalState normalState = new NormalState();
    public final static BuddhaLikeState buddhaLikeState = new BuddhaLikeState();
    public final static PeriodState periodState = new PeriodState();
    public final static ExcitedState excitedState = new ExcitedState();

    private EmotionalState emotionalState;

    public EmotionalState getEmotionalState() {
        return emotionalState;
    }

    public void setEmotionalState(EmotionalState emotionalState) {
        this.emotionalState = emotionalState;

        this.emotionalState.setContext(this);
    }

    public void normalState() {
        this.emotionalState.normalState();
    }

    public void buddhaLikeState() {
        this.emotionalState.buddhaLikeState();
    }

    public void periodState() {
        this.emotionalState.periodState();
    }

    public void excitedState() {
        this.emotionalState.excitedState();
    }
}
